<?php

use yii\db\Migration;

/**
 * Class m171229_060526_add_column_to_mortgage
 */
class m171229_060526_add_column_to_mortgage extends Migration
{
    /**
     * @inheritdoc
     */
    public function safeUp()
    {
//        表 project 添加mortgage_details抵押物详情描述
        $this->addColumn('project','mortgage_details',$this->text()->comment('抵押物详情描述'));
//        表 project_pre_evaluation_seal 添加
//        最高抵押额度（元）maximum_mortgage
        $this->addColumn('project_pre_evaluation_seal','maximum_mortgage',$this->string()->comment('最高抵押额度（元）'));
//        剩余使用年限remaining_service_life
        $this->addColumn('project_pre_evaluation_seal','remaining_service_life',$this->string()->comment('剩余使用年限'));
//        抵押物抵押顺序 mortgage_order
        $this->addColumn('project_pre_evaluation_seal','mortgage_order',$this->string()->comment('抵押物抵押顺序'));
//         抵押情况描述mortgage_situation
        $this->addColumn('project_pre_evaluation_seal','mortgage_situation',$this->string()->comment('抵押情况描述'));


    }

    /**
     * @inheritdoc
     */
    public function safeDown()
    {
        echo "m171229_060526_add_column_to_mortgage cannot be reverted.\n";

        return false;
    }

    /*
    // Use up()/down() to run migration code without a transaction.
    public function up()
    {

    }

    public function down()
    {
        echo "m171229_060526_add_column_to_mortgage cannot be reverted.\n";

        return false;
    }
    */
}
